<?php
	/**
	 * @package AmpleHarvest
	 */
	namespace ampleharvest\code;
	/**
	 * @brief This class holds all the Configuration Variables for AmpleHarvest Code
	 *
	 * - Revision History
	 *  - 0.1
	 * 	 - <b>Date</b>: 24 MAR 2011
	 * 	 - <b>Author</b>: Randy Blancett
	 * 	  - Initial Version
	 *
	 * @author Randy Blancett
	 * @ingroup code config classes
	 */
	if (!class_exists("ampleharvest\code\cConfig"))
	{
		class cConfig
		{
			/** @brief GUID used to identify the Reaper Source. */
			const C_STR_SOURCE_REAPER = "E612D828-FD60-4413-A33D-60F94E3ECEBC";
			
			/** @brief GUID used to identify the OctoberSky Source.*/
			const C_STR_SOURCE_OCTOBERSKY = "82750349-F99E-4D7B-816D-253255F04301";
			
			/** @brief GUID used to identify the GroundEffect Source. */
			const C_STR_SOURCE_GROUNDEFFECT = "8F899A50-9918-4135-826A-14FB93595615";
			
			const C_STR_STOMP_SERVER = "192.168.20.133";
			const C_STR_STOMP_PORT = "61613";
			
			const C_STR_PATH_PHP = "C:/XAMPP/PHP/PHP.EXE";
			
			const C_STR_SMTP_HOST = "127.0.0.1";
			
			const C_STR_SOLR_HOST = "192.168.20.127";
			const C_INT_SOLR_PORT = 8983;
			const C_STR_SOLR_SVR_PATH = "/solr-reaper";
			const C_STR_SOLR_QUEUE = "/queue/reaper.new";
			
			const C_STR_SOLR_HOST_OS = "192.168.20.127";
			const C_INT_SOLR_PORT_OS = 8983;
			const C_STR_SOLR_SVR_PATH_OS = "/solr-reaper";
			const C_STR_SOLR_QUEUE_OS = "/queue/reaper.new";
			
			const C_STR_SOLR_HOST_GE = "192.168.20.127";
			const C_INT_SOLR_PORT_GE = 8983;
			const C_STR_SOLR_SVR_PATH_GE = "/solr-reaper";
			const C_STR_SOLR_QUEUE_GE = "/queue/reaper.new";
			
			const C_INT_LOG_LEVEL = 200;
			
			const C_STR_AMPLE_SILO_USER_NAME = "test";
			const C_STR_AMPLE_SILO_PASSWORD = "test";
			const C_STR_AMPLE_SILO_BASE_URL = "http://192.168.20.127:8983";
			const C_INT_INDEX_CHUNK = 100;
			
			const C_STR_SSL_CAINFO = "";
			const C_STR_SSL_CERT = "";
			const C_STR_SSL_KEY = "";
			
			public static $WWW_ROOT_PHP_LIB = null;
			public static $WWW_ROOT_HTDOCS = null;
			
			public static $C_STR_INI_FILE = "cConfig";
			
			public $C_STR_WEB_PATH = null;
			public $C_STR_USER_MANAGER_PATH = null;
			public $C_STR_USER_MANAGER_LIB_PATH = null;
			public $C_STR_STOMP_LIB_PATH = null;
			public $C_STR_LOG_LIB_PATH = null;
			public $C_STR_DATABASE_LIB_PATH = "test";
			public $C_STR_PHP_MAILER_PATH = null;
			public $C_STR_SOLR_PATH = null;
			public $C_STR_SOLR_LIB_PATH = null;
			
			function __construct(){
					
				if (strtoupper(PHP_OS) == "LINUX")
				{					
					self::$WWW_ROOT_PHP_LIB = "/var/lib";
				   self::$WWW_ROOT_HTDOCS = "/var/www";
						
				}else  //Assume everything else is a flavor of windows for our xampp's.. WINNT
				{
					self::$WWW_ROOT_PHP_LIB = "C:/xampp/php_lib";
				   self::$WWW_ROOT_HTDOCS = "C:/xampp/";
				}
				
				$this->C_STR_WEB_PATH = "http://127.0.0.1/ampleharvest/";
				$this->C_STR_USER_MANAGER_PATH     = self::$WWW_ROOT_PHP_LIB."/User_Manager/";
				$this->C_STR_USER_MANAGER_LIB_PATH = self::$WWW_ROOT_PHP_LIB."/User_Manager/";
	
				$this->C_STR_STOMP_LIB_PATH    = self::$WWW_ROOT_PHP_LIB."/PHP_Stomp/";
				$this->C_STR_LOG_LIB_PATH      = self::$WWW_ROOT_PHP_LIB."/PHP_Log/";
				$this->C_STR_DATABASE_LIB_PATH = self::$WWW_ROOT_PHP_LIB."/PHP_Database";
				$this->C_STR_PHP_MAILER_PATH   = self::$WWW_ROOT_PHP_LIB."/PHP_Mailer";
				$this->C_STR_SOLR_PATH         = self::$WWW_ROOT_PHP_LIB."/Solr_Search/";
				$this->C_STR_SOLR_LIB_PATH     = self::$WWW_ROOT_PHP_LIB."/SolrPhpClient/";
			}
			
			
			private static function setIniFile($str_Name)
			{
					$obj_IniFile = fopen($str_Name, 'w');
					//Search GUID
					fwrite($obj_IniFile, "[Search_GUID]\n");
					fwrite($obj_IniFile, "C_STR_SOURCE_GROUNDEFFECT = ".self::C_STR_SOURCE_GROUNDEFFECT."\n");
					fwrite($obj_IniFile, "C_STR_SOURCE_OCTOBERSKY = ".self::C_STR_SOURCE_OCTOBERSKY."\n");
					fwrite($obj_IniFile, "C_STR_SOURCE_REAPER = ".self::C_STR_SOURCE_REAPER."\n");
					
					fclose($obj_IniFile);
			}

			public static function init()
			{
				$str_IniFileName = dirname(__FILE__) . "/" . self::$C_STR_INI_FILE . ".ini";
			}
			
			public static function get_Constants()
			{
				$arr_Output = array();
				
				$arr_Output['C_STR_SOURCE_REAPER'] = self::C_STR_SOURCE_REAPER;
				$arr_Output['C_STR_SOURCE_OCTOBERSKY'] = self::C_STR_SOURCE_OCTOBERSKY;
				$arr_Output['C_STR_SOURCE_GROUNDEFFECT'] = self::C_STR_SOURCE_GROUNDEFFECT;
								
				return $arr_Output;
			}
		}
		\ampleharvest\code\cConfig::init();
	}
?>